Fix Product::setConsiderStock() - must be of type bool, string given - #24
Fix Product::setConsiderStock() - must be of type bool, string given#24Marco (marcoherzog) wants to merge 1 commit into
Conversation
In woo-jtl-connector/vendor/jtl/connector/src/Model/Product.php the method setConsiderStock expects its argument to be boolean. But the return value from WooCommerce can actually be mixed. In this case the string 'yes' or 'no'. The patch converts 'yes' to boolean true.
|
Exception: Jtl\Connector\Core\Model\Product::setConsiderStock(): Argument #1 ($considerStock) must be of type bool, string given, called in /var/www/vhosts/carubina.com/wp/production/releases/118/web/app/plugins/woo-jtl-connector/src/Controllers/ProductController.php on line 135 Problemfunction get_prop returns mixed ('yes' or 'no' string) while function setConsiderStock expects boolean. Trace/woo-jtl-connector/src/Controllers/ProductController.php /woo-jtl-connector/vendor/jtl/connector/src/Model/Product.php function setConsiderStock expects $considerStock to be boolean. /woocommerce/includes/abstracts/abstract-wc-product.php /woocommerce/includes/abstracts/abstract-wc-product.php web/app/plugins/woocommerce/includes/abstracts/abstract-wc-data.php get_prop can return mixed. |
In woo-jtl-connector/vendor/jtl/connector/src/Model/Product.php the method setConsiderStock expects its argument to be boolean. But the return value from WooCommerce can actually be mixed. In this case the string 'yes' or 'no'. The patch converts 'yes' to boolean true.